<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>

    <script>
        function fun1() {
            alert("打开弹窗")
        }

        function fun2() {
            var result = confirm("确定打开百度吗？")
            if(result) {
                window.location.href = 'http://www.baidu.com'
            } else {
                alert("未打开百度")
            }
        }

        function fun3(){
            var result = prompt("请输入数字")
            console.log("result = " + result)
        }
    </script>
</head>
<body>
    <input type="button" value="打开弹窗" onclick="fun1()" />
    <input type="button" value="跳百度" onclick="fun2()" />
    <input type="button" value="打印" onclick="fun3()" />
    
    
</body>
</html>